#ifndef CHARACTERCLIENT_H
#define CHARACTERCLIENT_H

#include <string>
#include <SFML\Graphics.hpp>
#include <SFML\Network.hpp>

#include "DirectionPosition.h"

class CharacterClient {

public :

	/*Stock les textures pour les personnages*/
	sf::Texture characterRunLeft;
	sf::Texture characterRunRight;
	sf::Texture characterFacingLeft;
	sf::Texture characterFacingRight;
	sf::Texture characterJumpingRight;
	sf::Texture characterJumpingLeft;
	sf::Texture characterDead;

	sf::Vector2f position;
	sf::Sprite characterSprite;

	/*Matrice permettant de gerer la collision Box et la place du sprite sur les texture*/
	sf::Vector2f textureRunLeftSequence[8];
	sf::Vector2f textureRunRightSequence[8];
	sf::Vector2f textureFaceLeftSequence[8];
	sf::Vector2f textureFaceRightSequence[8];
	sf::Vector2f textureDeadSequence[4];
	sf::Vector2f textureJumpRight;
	sf::Vector2f textureJumpLeft;

	characterDirection chDirection;
	characterAction chAction;
	int nbPoints;
	bool youwin;
	int sequence, count;
	std::string extension;

	sf::Color characterColor;
	sf::Clock chronoTime, chronoFace;
	sf::Time time;
	sf::Time timeFace;
	sf::Time vitesseMove;
	sf::Time vitesseFace;
	sf::Time timeBeforeFace;

	CharacterClient(sf::Color charactColor);
	void draw(sf::RenderWindow& w);
	void deplacement();
	void incSequence();
	void setPosition(int x, int y);
	void receive( sf::TcpSocket& socket );
	void animationPlayer1();
	bool hasWon();
};

#endif